<%inherit file="base.html"/>

<%def name="head()">
<script>
    function deleteRadius(radius_id)
    {
        if(confirm("确认删除吗？"))
        {
            window.location.href = "/radius/delete?radius_id="+radius_id;
        }
    }

</script>
</%def>

<%def name="body()">
<section class="content">
    <div class="box box-primary">
        <div class="box-header">
            <i class="fa fa-sitemap"></i>
            <h3 class="box-title">Radius节点列表</h3>
        </div>
        <div class="box-body">
            <div class="container">

                <table class="table table-hover">
                    <thead>
                        <tr>
                            <th>Radius名称</th>
                            <th>Radius地址</th>
                            <th>共享密钥</th>
                            <th>管理端口</th>
                            <th>认证端口</th>
                            <th>计费端口</th>
                            <th>连接状态</th>
                            <th>最后检测时间</th>
                        </tr>
                    </thead>
                    <tbody>
                        % for item in radius_list:
                            <tr>
                                <td><a href="/radius/detail?radius_name=${item.name}">${item.name}</a></td>
                                <td>${item.ip_addr}</td>
                                <td>${item.secret}</td>
                                <td>${item.admin_port}</td>
                                <td>${item.auth_port}</td>
                                <td>${item.acct_port}</td>
                                <td>${radius_status[item.status]}</td>
                                <td>${item.last_check}</td>
                                </td>
                                <td>
                                    % if permit.match(current_user.username,'/radius/delete'):
                                    <a class="opt-btn btn-default" href="javascript:deleteRadius('${item.id}')">删除</a>
                                    % endif
                                </td>
                            </tr>
                        % endfor
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</section>
</%def>